<?php

namespace App\Providers;

use App\Facades\Router;
use Core\Router as CoreRouter;
use Core\ServiceProvider;

class RouteServiceProvider extends ServiceProvider
{
    public function register()
    {
        // 绑定路由服务
        $this->container->singleton('router', function ($container) {
            return new CoreRouter($container);
        });
    }

    public function boot()
    {
        Router::get('/', 'User@index');
        Router::get('/user/list', 'User@list');
        Router::get('/user/{id}', 'User@info');
        Router::delete('/user/{id}', 'User@delete');
    }
}
